<!DOCTYPE html>
<title>Test "source" element.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<video>
    <source></source>
</video>
<script>
async_test(function(t) {
    var video = document.querySelector("video");
    var source = document.querySelector("source");
    var mediaFile = "content/test.ogv";
    source.src = mediaFile;

    video.onloadstart = t.step_func_done(function() {
        var url = video.currentSrc;
        assert_equals(url.substr(url.lastIndexOf("/media/") + 7), mediaFile);

        assert_equals(source.getAttribute("src"), mediaFile);

        url = source.src;
        assert_equals(url.substr(url.lastIndexOf("/media/") + 7), mediaFile);
    });
});
</script>